<?php
    header("content-type:text/html; charset=utf8");
    $con = mysqli_connect("localhost", "root", "guodong", "study");
    mysqli_set_charset($con, "utf8");

    $id = $_POST['id'];
    echo $id;

    if ($con) {
        echo "数据库连接成功！";
        $sql = "DELETE FROM stu WHERE id='$id'";
        $result = mysqli_query($con, $sql);

        if ($result > 0) {
            echo "删除成功！";
        } else {
            echo "删除失败！";
        }
    } else {
        echo "数据库连接失败！";
    }
